package cn.edu.hizee.gps.model;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "t_user_info", schema = "EHelp", catalog = "")
public class UserInfo {
    private int id;
    private Integer userId;
    private String sfzno;
    private String imagePath;
    private String age;
    private String sex;
    private String height;
    private String blood;
    private String illness;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "user_id")
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "sfzno")
    public String getSfzno() {
        return sfzno;
    }

    public void setSfzno(String sfzno) {
        this.sfzno = sfzno;
    }

    @Basic
    @Column(name = "image_path")
    public String getImagePath() {
        return imagePath;
    }

    public void setImagePath(String imagePath) {
        this.imagePath = imagePath;
    }

    @Basic
    @Column(name = "age")
    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    @Basic
    @Column(name = "sex")
    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    @Basic
    @Column(name = "height")
    public String getHeight() {
        return height;
    }

    public void setHeight(String height) {
        this.height = height;
    }

    @Basic
    @Column(name = "blood")
    public String getBlood() {
        return blood;
    }

    public void setBlood(String blood) {
        this.blood = blood;
    }

    @Basic
    @Column(name = "illness")
    public String getIllness() {
        return illness;
    }

    public void setIllness(String illness) {
        this.illness = illness;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserInfo userInfo = (UserInfo) o;
        return id == userInfo.id &&
                Objects.equals(userId, userInfo.userId) &&
                Objects.equals(sfzno, userInfo.sfzno) &&
                Objects.equals(imagePath, userInfo.imagePath) &&
                Objects.equals(age, userInfo.age) &&
                Objects.equals(sex, userInfo.sex) &&
                Objects.equals(height, userInfo.height) &&
                Objects.equals(blood, userInfo.blood) &&
                Objects.equals(illness, userInfo.illness);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, userId, sfzno, imagePath, age, sex, height, blood, illness);
    }
}
